import Mock from 'mockjs';
let Random = Mock.Random;
export const data = Mock.mock('https://ecc.weadmin.com/getBannerList', {
  list: [
    {
      id: 1,
      url:
        'https://b4-q.mafengwo.net/s12/M00/55/54/wKgED1wBAvOAEpjbAAQtIw_KiTg62.jpeg'
    },
    {
      id: 2,
      url:
        'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg'
    },
    {
      id: 3,
      url:
        'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg'
    }
  ]
});

export const recomdData = Mock.mock('https://ecc.weadmin.com/getRecomdList', {
  list: [
    {
      id: 1,
      url:
        'https://b4-q.mafengwo.net/s12/M00/55/54/wKgED1wBAvOAEpjbAAQtIw_KiTg62.jpeg',
      title: '马加利亚大教堂',
      price: 15.66
    },
    {
      id: 2,
      url:
        'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
      title: '马加利亚大教堂',
      price: 15.66
    },
    {
      id: 3,
      url:
        'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
      title: '马加利亚大教堂',
      price: 15.66
    },
    {
      id: 4,
      url:
        'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
      title: '马加利亚大教堂',
      price: 15.66
    },
    {
      id: 5,
      url:
        'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
      title: '马加利亚大教堂',
      price: 15.66
    }
  ]
});
export const latestData = Mock.mock('https://ecc.weadmin.com/getLatestList', {
  list: [
    {
      id: 1,
      url:
        'https://b4-q.mafengwo.net/s12/M00/55/54/wKgED1wBAvOAEpjbAAQtIw_KiTg62.jpeg',
      title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
      price: 15.66
    },
    {
      id: 2,
      url:
        'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
      title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
      price: 15.66
    },
    {
      id: 3,
      url:
        'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
      title: '马德里王宫 齐名凡尔赛 (电子票＋导览)',
      price: 15.66
    },
    {
      id: 4,
      url:
        'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
      title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
      price: 15.66
    },
    {
      id: 5,
      url:
        'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
      title: '法国巴黎卢浮宫博物馆免排队 快速通道欧洲景点电子票',
      price: 15.66
    },
    {
      id: 6,
      url:
        'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
      title:
        '因为美食爱上一个地方，西班牙七大tapas美食之城，把所有怪诞奇趣的幻想，一股脑地塞进一座城，就成了 巴塞罗那，把所有怪诞奇趣的幻想，一股脑地塞进一座城，就成了 巴塞罗那',
      price: 15.66
    }
  ]
});
export const experienceData = Mock.mock(
  'https://ecc.weadmin.com/getExperList',
  {
    list: [
      {
        id: 1,
        url:
          'https://b4-q.mafengwo.net/s12/M00/55/54/wKgED1wBAvOAEpjbAAQtIw_KiTg62.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 2,
        url:
          'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
        title:
          '因为美食爱上一个地方，西班牙七大tapas美食之城，把所有怪诞奇趣的幻想，一股脑地塞进一座城，就成了 巴塞罗那，把所有怪诞奇趣的幻想，一股脑地塞进一座城，就成了 巴塞罗那',
        price: 15.66
      },
      {
        id: 3,
        url:
          'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 4,
        url:
          'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 5,
        url:
          'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      }
    ]
  }
);
export const distinctData = Mock.mock(
  'https://ecc.weadmin.com/getDistinctList',
  {
    list: [
      {
        id: 1,
        url:
          'https://b4-q.mafengwo.net/s12/M00/55/54/wKgED1wBAvOAEpjbAAQtIw_KiTg62.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 2,
        url:
          'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 3,
        url:
          'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 4,
        url:
          'https://p2-q.mafengwo.net/s12/M00/55/B4/wKgED1wBA0uAWbQLAAcMt7ivOZI74.jpeg',
        title: '因为美食爱上一个地方，西班牙七大tapas美食之城',
        price: 15.66
      },
      {
        id: 5,
        url:
          'https://p1-q.mafengwo.net/s12/M00/42/7A/wKgED1wF6mqAOswkAAfS3Veeuqg31.jpeg',
        title:
          '因为美食爱上一个地方，西班牙七大tapas美食之城,彩色阳光 西班牙/葡萄牙11日记 | 像是谈了一场天马行空的恋爱',
        price: 15.66
      }
    ]
  }
);

export const detailData = Mock.mock('https://ecc.weadmin.com/getDetail', {
  id: Mock.mock('@integer(1, 100)'),
  title: '@TITLE',
  'imgs|0-10': [Random.image('200*200', '@color()')],
  address: Random.county(true),
  extraService: ['极速出票', '免兑换', '语音导览']
});

export const typeData = Mock.mock('https://ecc.weadmin.com/getTypes', {
  'type|1-5': [
    {
      'id|+1': 1,
      title: '@csentence(15,20)',
      price: '@integer(100,10000)',
      childPrice: '@integer(100,10000)'
    }
  ]
});

export const commentData = Mock.mock('https://ecc.weadmin.com/getCommentList', {
  'list|10': [
    {
      'id|+1': 1,
      nickname: Random.name(),
      createTime: Random.datetime(),
      content: '@cparagraph()',
      'imgs|0-10': [Random.image('200*200', '@color()')]
    }
  ],
  count: 67
});
export const loginData = Mock.mock('https://ecc.weadmin.com/login', {
  userInfo: {
    id: 11,
    nickname: 'syuenkei',
    phone: 13548953846,
    sex: 0,
    avatar:
      'http://n1-q.mafengwo.net/s9/M00/83/65/wKgBs1esZeaAYzUhAAKsB07bCjs60.jpeg'
  },
  token: 'fsjdaklsdjflasdfja'
});
export const editData = Mock.mock('https://ecc.weadmin.com/editInfo', {
  userInfo: {
    id: 11,
    nickname: 'syuenkei',
    phone: 13548953846,
    sex: 0,
    avatar:
      'http://n1-q.mafengwo.net/s9/M00/83/65/wKgBs1esZeaAYzUhAAKsB07bCjs60.jpeg'
  }
});

export const getOrderList = Mock.mock('https://ecc.weadmin.com/getOrderList', {
  'list|35': [
    {
      'id|+1': 1,
      createTime: '@datetime()',
      useTime: '@datetime()',
      price: '@integer(100,1000)',
      product: {
        id: '@integer(1)',
        'imgs|0-5': [Random.image('200*200', '@color()')],
        title: '@csentence(15,50)'
      },
      state: '@integer(0,3)',
      customer: '@cname()',
      orderno: '@integer(10000)'
    }
  ],
  count: 35
});

export const commentDetail = Mock.mock(
  'https://ecc.weadmin.com/getCommentDetail',
  {
    id: '@integer(1,5)',
    content: '@cparagraph()',
    'imgs|0-10': [Random.image('200*200', '@color()')]
  }
);
export const messageList = Mock.mock('https://ecc.weadmin.com/getMessageList', {
  'list|0-15': [
    {
      'id|+1': 1,
      createTime: '@datetime()',
      content: '@cparagraph()'
    }
  ]
});
export const delMessage = Mock.mock('https://ecc.weadmin.com/delMessage', {});
export const postCommentData = Mock.mock(
  'https://ecc.weadmin.com/postComment',
  {
    id: 100
  }
);
export const collectList = Mock.mock('https://ecc.weadmin.com/getCollections', {
  'list|0-35': [
    {
      'id|+1': 1,
      price: '@integer(100,1000)',
      'imgs|0-5': [Random.image('200*200', '@color()')],
      title: '@csentence(15,50)',
      state: '@integer(0,1)',
      type: '@TYPES'
    }
  ],
  count: 35
});
export const delCollections = Mock.mock('https://ecc.weadmin.com/delCollect', {
  id: 90
});

export const couponList = Mock.mock('https://ecc.weadmin.com/getCouponList', {
  'list|0-10': [
    {
      'id|+1': 1,
      value: '@integer(1,500)',
      'imgs|0-5': [Random.image('200*200', '@color()')],
      title: '@csentence(5,8)',
      state: '@integer(0,1)',
      expireTime: '@date()',
      type: '@integer(0,1)'
    }
  ]
});
Random.extend({
  title: function(date) {
    let title = [
      '彩色阳光 西班牙/葡萄牙11日记 | 像是谈了一场天马行空的恋爱',
      '把所有怪诞奇趣的幻想，一股脑地塞进一座城，就成了 巴塞罗那',
      '最销魂的那一种风情，一定来自 安达卢西亚',
      '从晨曦里的微光到夜晚的暧昧柔软， 塞维利亚 的温度是这一程最销魂的温暖'
    ];
    return this.pick(title);
  }
});
Random.extend({
  types: function() {
    let types = ['attractions', 'show', 'contest', 'experience'];
    return this.pick(types);
  }
});
Random.extend({
  commentContent: function(date) {
    let commentContent = [
      '瑟小姐我先占个地方哈哈 路上没办法 回去慢慢看 看你这趟可比我之前拍得好看太多',
      '哈哈哈我变成瑟小姐啦… 超羡慕你在长白山玩儿雪。记得去吃东北铁锅炖，万达学场附近那个小村子里有特别好吃的铁锅炖～～',
      '呃！我今年3月底去的西葡，感觉也没你的天气好，而且懒癌晚期到现在还没整理单反照片！感觉你发的别我照的都多',
      '这流浪汉可能是天使，或者就是耶稣大哥本人呢',
      '看到你的游记啦，刚好明后年准备去印度，取经避坑啦。'
    ];
    return this.pick(commentContent);
  }
});
Random.integer();
